package com.zhuss.${moudle}.processor;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

import com.zhuss.bean.vo.${moudle}.${poEntityLower}.Detail${poEntity}Vo;
import com.zhuss.enums.StartStopEnum;
import com.zhuss.exception.DzcxException;


@Component("${poEntityLower}Check")
public class ${poEntity}Check {
	
	@Autowired
	@Qualifier("${poEntityLower}Read")
	private ${poEntity}Read ${poEntityLower}Read;

	
	public boolean checkStart(Long ${poEntityLower}Id) throws DzcxException {
		Detail${poEntity}Vo ${poEntityLower} = ((Detail${poEntity}Vo) ${poEntityLower}Read.detail(${poEntityLower}Id));
		if (StartStopEnum.停用.sameKey(${poEntityLower}.getStatus())) {
			return true;
		}
		return false;
	}
	
	public boolean checkStop(Long ${poEntityLower}Id) throws DzcxException {
		Detail${poEntity}Vo ${poEntityLower} = ((Detail${poEntity}Vo) ${poEntityLower}Read.detail(${poEntityLower}Id));
		if (StartStopEnum.启用.sameKey(${poEntityLower}.getStatus())) {
			return true;
		}
		return false;
	}
	
}
